package com.pkx.cloud.fse7.dms.openrecord.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pkx.cloud.fse7.dms.openrecord.entity.OpenRecordView;
import com.pkx.cloud.fse7.dms.openrecord.service.OpenRecordViewService;
import com.pkx.cloud.whzx.comn.ORpose;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *  控制器
 *
 * @author chenwg
 * @since 2020-10-14
 */
@RestController
@RequestMapping("/dms/open-record-view")
@Api(value = "", tags = "")
@Slf4j
@ORpose
public class OpenRecordViewController {

    @Autowired
    private OpenRecordViewService openRecordViewService;

    @ApiOperation("分页列表")
    @GetMapping("/page")
    public Page<OpenRecordView> page(Page page, OpenRecordView openRecordView) {
        return openRecordViewService.pageList(page,openRecordView);
    }

    @ApiOperation("列表")
    @GetMapping("/list")
    public List<OpenRecordView> list(OpenRecordView openRecordView) {
        return openRecordViewService.listByEntity(openRecordView);
    }

    @ApiOperation("详情")
    @GetMapping(value = "/{id}")
    public OpenRecordView selectById(@PathVariable("id") Long id) {
        return openRecordViewService.selectById(id);
    }

}
